﻿using System;
using Microsoft.Phone.Controls;

namespace Lastfm7
{
    public partial class ArtistListPage : PhoneApplicationPage
    {
        public ArtistListPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var profile = App.Current.ProfileViewModel;
            switch(NavigationContext.QueryString["mode"])
            {
                case "top":
                    DataContext = profile.TopArtistsModel;
                    break;
                case "rec":
                    DataContext = profile.RecommendedArtistsModel;
                    break;
                default:
                    throw new NotSupportedException();
            }
        }
    }
}